﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="Report_SKU" Codebehind="SKU.aspx.cs" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>

    <script type="text/javascript" src="../Include/JS/Lib/jquery-1.1.4.js"></script>

    <script type="text/javascript" src="../Include/JS/calendar.js"></script>

    <script type="text/javascript" src="../Include/Js/PopupCalendar.js"></script>

    <script type="text/javascript" src="../Include/Js/OpenWindow.js"></script>

    <script language="javascript" type="text/javascript">
    var  $j = jQuery.noConflict();
    function setValue(sp)
    {
        var txtSP=document.getElementById("<%=txtSP.ClientID %>");
        txtSP.innerText=sp;
    }
    function getOrderFrom(path)
    {
        var orderFrom=window.showModalDialog(path+"DialogBoxHostFrame.aspx?url=Report/SelectOrderFrom.aspx",window,"status:off;center=yes;edge:raised;dialogHeight:525px;dialogWidth:530px;help:0;resizable:0;scrollbar=0");
        if(orderFrom==undefined)
        {
            document.all("DDL_OrderFrom").value="";//没有选择支付方式时，默认是现金支付

        }
        else
        {
            document.all("DDL_OrderFrom").value=orderFrom;
        }
    }
    function GetSuggestion(path)
    {
        var suggestion=window.showModalDialog(path+"DialogBoxHostFrame.aspx?url=Report/SelectSuggestion.aspx",window,"status:off;center=yes;edge:raised;dialogHeight:525px;dialogWidth:530px;help:0;resizable:0;scrollbar=0");
        if(suggestion==undefined)
        {
            document.all("DDL_ORDER_STATETYPECODE").value="";//没有选择支付方式时，默认是现金支付

        }
        else
        {
            document.all("DDL_ORDER_STATETYPECODE").value=suggestion;
        }
    }
    function GetPayType(path)
    {
        var payType=window.showModalDialog(path+"DialogBoxHostFrame.aspx?url=Report/SelectPayType.aspx",window,"status:off;center=yes;edge:raised;dialogHeight:525px;dialogWidth:530px;help:0;resizable:0;scrollbar=0");
        if(payType==undefined)
        {
            document.all("DDL_PayType").value="";//没有选择支付方式时，默认是现金支付

        }
        else
        {
            document.all("DDL_PayType").value=payType;
        }
    }
    function GetDealType(path)
    {
        var dealType=window.showModalDialog(path+"DialogBoxHostFrame.aspx?url=Report/SelectDealType.aspx",window,"status:off;center=yes;edge:raised;dialogHeight:525px;dialogWidth:530px;help:0;resizable:0;scrollbar=0");
        if(dealType==undefined)
        {
            document.all("DDL_tradetype").value="";//没有选择支付方式时，默认是现金支付

        }
        else
        {
            document.all("DDL_tradetype").value=dealType;
        }
    }
    function GetOperator(path,objId)
    {
        var operator=window.showModalDialog(path+"DialogBoxHostFrame.aspx?url=Report/SelectOperator.aspx",window,"status:off;center=yes;edge:raised;dialogHeight:525px;dialogWidth:530px;help:0;resizable:0;scrollbar=0");
        if(operator==undefined)
        {
            document.all(objId).value="";//没有选择支付方式时，默认是现金支付

        }
        else
        {
            document.all(objId).value=operator;
        }
    }
    </script>
    <style type="text/css">
body {font-size:12px;margin:0;padding:0;}
a:visited{text-decoration:none;color:slategray;}
a:hover{text-decoration:underline;color:slategray;}
a:link{text-decoration:none;color:slategray;}
.juli {margin-top:10px;padding-left:20px;}
.z1{background-color:#e7e7e7; text-align:left; line-height:20px;}
.z2{background-color:#FFFFFF; text-align:left; line-height:20px;}
.zt3 {text-align:center; font-weight:600; color:#000000;}
.zt4 {text-align:center; color:#000000;}
.zt5 {text-align:right; font-weight:bold; font-family:Arial, Helvetica, sans-serif; color:#0000ff;}
.zt7 {text-align:right; color:#000000;}
.tb {width: 90%; background-color:#999999;}
a.lj {font-size:12px; color:#ff9900; text-decoration:underline;}
a.lj:link {font-size:12px; color:#ff9900; text-decoration:underline;}
a.lj:visited {font-size:12px; color:#ff9900; text-decoration:underline;}
a.lj:hover {color:#ff3300;}
a.lj:active {color:#ff3300;}
.menu_bg { background-color:#fef3bb; padding-left:20px;padding-top:6px; padding-bottom:6px;border-bottom:#cf994b 1px solid;}
.menu_bg3 { background-color:#f5f5f5; font-weight:bold; padding-left:20px;padding-top:6px; padding-bottom:6px;border-bottom:#cccccc 1px solid;border-top:#cccccc 1px solid;clear:left;width:2000px;}
.input_button {width:52px;height:23px;border:none;cursor:pointer; background:#ffffff url(../Include/Images/bt.gif) no-repeat;}
.input_button1 {width:74px;height:23px;border:none;cursor:pointer; background:#ffffff url(../Include/Images/bt1.gif) no-repeat;}
.input_button4 {width:52px;height:23px;border:none;cursor:pointer; background:#ffffff url(../Include/Images/bt.gif) no-repeat;font-weight:bold;}.menu_bg { background-color:#fef3bb; padding-left:20px;padding-top:6px; padding-bottom:6px;border-bottom:#cf994b 1px solid; width:2000px;}
.menu_bg5 { background-color:#fef3bb; padding-left:20px;padding-top:6px; padding-bottom:6px;border-bottom:#cf994b 0px solid; width:2000px;}
.input_longtextbutton {width:74px;height:23px;border:none;cursor:pointer; background:#ffffff url(../Include/Images/bt1.gif) no-repeat;}
.input_button3 {width:95px;height:23px;border:none;background:#ffffff url(../Include/Images/bt2.gif) no-repeat;}
h2 {padding-left:20px;padding-top:10px;margin:0; width:2000px; background: url(../Include/Images/menu_title.gif) repeat-x;height:21px;font-size:14px; font-weight:600;}
.divbackground
{
z-index:9;display:none;position:absolute;width:1120px;height:1040px;left:0px;top:0px;background-color:#8C8C8C;opacity: 0.5;filter:alpha(opacity=50,finishopacity=50,style=1);}
.tx1{width:80px;}
.tx2{width:50px;}
</style>
</head>
<body>
    <form id="form1" runat="server">
        <h2>
            SKU销售排行榜</h2>
        <asp:DataGrid ID="DataGrid" runat="server" OnItemDataBound="DataGrid_ItemDataBound">
        </asp:DataGrid>
        <div class="menu_bg">
            <asp:Button ID="btnSearch" runat="server" class="input_button" Text="查询" OnClick="btnSearch_Click" />
            <asp:Button ID="Button1" runat="server" class="input_button" Text="导出" OnClick="btnExport_Click" />
        </div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
        </asp:ScriptManager>
        <div class="menu_bg">
            <div style="display: none">
                仓库：<asp:DropDownList ID="drpKW" runat="server">
                </asp:DropDownList></div>
            <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        订单来源:</td>
                    <td>
                        <input type="text" id="DDL_OrderFrom" runat="server" onclick="getOrderFrom('../')" readonly="readonly" class="tx1" />
                        </td>
                    <td>
                        商品:</td>
                    <td>
                        <asp:TextBox ID="txtSP" runat="server" ReadOnly="true" CssClass="tx1"></asp:TextBox></td>
                    <td>
                        <input type="button" id="selSP" class="input_button1" value="清空商品" onclick="setValue('');" /></td>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td>
                        上架时间:</td>
                    <td>
                        <asp:TextBox ID="txtUpStartTime" CssClass="tx1" runat="server" OnClick="setday(this)"></asp:TextBox>-<asp:TextBox
                            ID="txtUpEndTime" runat="server" CssClass="tx1" OnClick="setday(this)"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>
                        订单编号:</td>
                    <td>
                        <asp:TextBox ID="Tbx_OrderID" runat="server" CssClass="tx1"></asp:TextBox></td>
                    <td>
                        关联订单编号:</td>
                    <td>
                        <asp:TextBox ID="Tbx_LinkOrder" runat="server" CssClass="tx1"></asp:TextBox></td>
                    <td></td><td></td>
                    <td>
                        订单意见:</td>
                    <td>
                        <input type="text" id="DDL_ORDER_STATETYPECODE" runat="server" class="tx1" readonly="readonly" onclick="GetSuggestion('../')"/></td>
                    <td style="display: none">
                        制单人:</td>
                    <td style="display: none">
                        <input type="text" id="DDL_OrderCreater" runat="server"  class="tx1" readonly="readonly" onclick="GetOperator('../',this.id)"/>
                        </asp:DropDownList>
                    </td>
                    <td>
                        制单日期:</td>
                    <td>
                        <asp:TextBox ID="Tbx_OrderCreateF" runat="server" CssClass="tx1" OnClick="setday(this)"></asp:TextBox>-<asp:TextBox
                            ID="Tbx_OrderCreateT" runat="server" CssClass="tx1" OnClick="setday(this)"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>
                        会员:</td>
                    <td>
                        <asp:TextBox ID="Tbx_CustomerCode" runat="server" CssClass="tx1"></asp:TextBox></td>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td>
                        交易类型:</td>
                    <td>
                        <input type="text" id="DDL_tradetype" runat="server" class="tx1" readonly="readonly" onclick="GetDealType('../')"/></td>
                    <td>
                        支付方式:</td>
                    <td>
                        <input type="text" id="DDL_PayType" runat="server"  class="tx1" readonly="readonly" onclick="GetPayType('../')"/></td>
                    <td>
                        审核日期:</td>
                    <td>
                        <asp:TextBox ID="Tbx_CheckDateF" runat="server" CssClass="tx1" OnClick="setday(this)"></asp:TextBox>-<asp:TextBox
                            ID="Tbx_CheckDateT" runat="server" CssClass="tx1" OnClick="setday(this)"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>
                        审核:</td>
                    <td>
                        <asp:DropDownList ID="DDL_Check" runat="server">
                            <asp:ListItem Value="-1">全部</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList></td>
                    <td>
                        财务审核:</td>
                    <td>
                        <asp:DropDownList ID="DDL_Acheck" runat="server">
                            <asp:ListItem Value="-1">全部</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList></td>
                    <td>
                        发货:</td>
                    <td>
                        <asp:DropDownList ID="DDL_Send" runat="server">
                            <asp:ListItem Value="-1">全部</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList></td>
                    <td>
                        结算:</td>
                    <td>
                        <asp:DropDownList ID="DDL_Clear" runat="server">
                            <asp:ListItem Value="-1">全部</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList></td>
                    <td>
                        发货日期:</td>
                    <td>
                        <asp:TextBox ID="Tbx_SendDateF" runat="server" CssClass="tx1" OnClick="setday(this)"></asp:TextBox>-<asp:TextBox
                            ID="Tbx_SendDateT" runat="server" CssClass="tx1" OnClick="setday(this)"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>
                        审核人:</td>
                    <td>
                        <input type="text" id="DDL_Checker" runat="server" class="tx1" readonly="readonly" onclick="GetOperator('../',this.id)"/></td>
                    <td>
                        财务审核人:</td>
                    <td>
                        <input type="text" id="DDL_aChecker" runat="server"  class="tx1" readonly="readonly" onclick="GetOperator('../',this.id)"/></td>
                    <td>
                        发货人:</td>
                    <td>
                        <input type="text" id="DDL_Sender" runat="server"  class="tx1" readonly="readonly" onclick="GetOperator('../',this.id)"/></td>
                    <td>
                        结算人:</td>
                    <td>
                        <input type="text" id="DDL_Clearer" runat="server"  class="tx1" readonly="readonly" onclick="GetOperator('../',this.id)"/></td>
                    <td>
                        财务审核日期:</td>
                    <td>
                        <asp:TextBox ID="Tbx_AcheckDateF" runat="server" CssClass="tx1" OnClick="setday(this)"></asp:TextBox>-<asp:TextBox
                            ID="Tbx_AcheckDateT" runat="server" CssClass="tx1" OnClick="setday(this)"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>
                        是否有退单:</td>
                    <td>
                        <asp:DropDownList ID="DDL_TuiHuo" runat="server">
                            <asp:ListItem Value="-1">全部</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList></td>
                    <td>
                        是否货到付款:</td>
                    <td>
                        <asp:DropDownList ID="DDL_HDFK" runat="server">
                            <asp:ListItem Value="-1">全部</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList></td>
                    <td></td><td></td>
                    <td style="display: none">
                        是否缺货订单:</td>
                    <td style="display: none">
                        <asp:DropDownList ID="DDL_QueHuo" runat="server">
                            <asp:ListItem Value="-1">全部</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList></td>
                    <td>
                        作废:</td>
                    <td>
                        <asp:DropDownList ID="DDL_ZF" runat="server">
                            <asp:ListItem Value="-1">全部</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList></td>
                    <td>
                        结算日期:</td>
                    <td>
                        <asp:TextBox ID="Tbx_ClearDateF" runat="server" CssClass="tx1" OnClick="setday(this)"></asp:TextBox>-<asp:TextBox
                            ID="Tbx_ClearDateT" runat="server" CssClass="tx1" OnClick="setday(this)"></asp:TextBox></td>
                </tr>
            </table>
        </div>
        <div class="menu_bg3">
            SKU销售排行榜</div>
        <div class="juli">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <asp:GridView ID="grdSKU" runat="server" BackColor="White" BorderColor="#999999"
                        BorderStyle="Solid" BorderWidth="1px" CellPadding="3" Height="1px" Width="100%"
                        AutoGenerateColumns="False" ShowFooter="True">
                        <Columns>
                            <asp:TemplateField HeaderText="序号" InsertVisible="False">
                                <FooterStyle BorderStyle="Solid" />
                                <HeaderStyle BackColor="#E7E7E7" BorderStyle="Solid" ForeColor="Black" HorizontalAlign="Center" />
                                <ItemStyle BorderStyle="Solid" />
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# this.grdSKU.PageIndex * this.grdSKU.PageSize + this.grdSKU.Rows.Count + 1%>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="款号" DataField="SPDM">
                                <FooterStyle BorderStyle="Solid" />
                                <HeaderStyle BackColor="#E7E7E7" BorderStyle="Solid" ForeColor="Black" HorizontalAlign="Center" />
                                <ItemStyle BorderStyle="Solid" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="颜色" DataField="COLORNAME">
                                <FooterStyle BorderStyle="Solid" />
                                <HeaderStyle BackColor="#E7E7E7" BorderStyle="Solid" ForeColor="Black" HorizontalAlign="Center" />
                                <ItemStyle BorderStyle="Solid" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="尺码" DataField="SIZENAME">
                                <FooterStyle BorderStyle="Solid" />
                                <HeaderStyle BackColor="#E7E7E7" BorderStyle="Solid" ForeColor="Black" HorizontalAlign="Center" />
                                <ItemStyle BorderStyle="Solid" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="商品名称" DataField="SPMC">
                                <FooterStyle BorderStyle="Solid" />
                                <HeaderStyle BackColor="#E7E7E7" BorderStyle="Solid" ForeColor="Black" HorizontalAlign="Center" />
                                <ItemStyle BorderStyle="Solid" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="销售数量" DataField="QTY" DataFormatString="{0:N0}" HtmlEncode="False">
                                <FooterStyle BorderStyle="Solid" CssClass="zt5" />
                                <HeaderStyle BackColor="#E7E7E7" BorderStyle="Solid" ForeColor="Black" HorizontalAlign="Center" />
                                <ItemStyle BorderStyle="Solid" HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="占比（数量）" DataField="QTY_RATE" DataFormatString="{0:N2}%"
                                HtmlEncode="False">
                                <FooterStyle BorderStyle="Solid" />
                                <HeaderStyle BackColor="#E7E7E7" BorderStyle="Solid" ForeColor="Black" HorizontalAlign="Center" />
                                <ItemStyle BorderStyle="Solid" HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="销售金额" ConvertEmptyStringToNull="False" DataField="AMT"
                                DataFormatString="{0:N2}">
                                <FooterStyle BorderStyle="Solid" CssClass="zt5" />
                                <HeaderStyle BackColor="#E7E7E7" BorderStyle="Solid" ForeColor="Black" HorizontalAlign="Center" />
                                <ItemStyle BorderStyle="Solid" HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="占比（金额）" DataField="AMT_RATE" DataFormatString="{0:N2}%"
                                HtmlEncode="False">
                                <FooterStyle BorderStyle="Solid" />
                                <HeaderStyle BackColor="#E7E7E7" BorderStyle="Solid" ForeColor="Black" HorizontalAlign="Center" />
                                <ItemStyle BorderStyle="Solid" HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="仓库" DataField="KW">
                                <FooterStyle BorderStyle="Solid" />
                                <HeaderStyle BackColor="#E7E7E7" BorderStyle="Solid" ForeColor="Black" HorizontalAlign="Center" />
                                <ItemStyle BorderStyle="Solid" HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="库存量" DataField="SL" DataFormatString="{0:N0}" HtmlEncode="False">
                                <FooterStyle BorderStyle="Solid" CssClass="zt5" />
                                <HeaderStyle BackColor="#E7E7E7" BorderStyle="Solid" ForeColor="Black" HorizontalAlign="Center" />
                                <ItemStyle BorderStyle="Solid" HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="可用量" DataField="SL3" DataFormatString="{0:N0}" HtmlEncode="False">
                                <FooterStyle BorderStyle="Solid" CssClass="zt5" />
                                <HeaderStyle BackColor="#E7E7E7" BorderStyle="Solid" ForeColor="Black" HorizontalAlign="Center" />
                                <ItemStyle BorderStyle="Solid" HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="周转期" DataField="PERIOD" DataFormatString="{0:N1}">
                                <FooterStyle BorderStyle="Solid" CssClass="zt5" />
                                <HeaderStyle BackColor="#E7E7E7" BorderStyle="Solid" ForeColor="Black" HorizontalAlign="Center" />
                                <ItemStyle BorderStyle="Solid" HorizontalAlign="Right" />
                            </asp:BoundField>
                        </Columns>
                    </asp:GridView>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
            <asp:HiddenField ID="hdSPDM" runat="server" />
        </div>
    </form>
</body>
</html>
